package digui;

/**
 * create by mwh 2021-12-30
 **/

public class DiGui {

    public static void main(String[] args) {
       int sum= sumNum(3);
        System.out.println("最终输出："+sum);
    }
    private static int sumNum(int n) {
        System.out.println("当前："+n);
        if (n == 1) {
            return 1;
        }
        int ret = n + sumNum(n-1);
        System.out.println("求和后："+ret);
        return ret;
    }




}
